﻿using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Swashbuckle.AspNetCore.Annotations;

namespace JWTAuthDemo.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class MenuController : ControllerBase
    {
        /// <summary>
        /// 获取菜单列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public IActionResult GetMenuList()
        {
            var menuList = new List<string> { "Home", "About", "Contact" };
            return Ok(menuList);
        }
        /// <summary>
        /// 获取菜单详情
        /// </summary>
        /// <param name="id" >菜单ID</param>
        /// <returns>返回菜单详情</returns>
        /// <example>222</example>
        
        [HttpGet("{id}")]
        public IActionResult GetMenuDetail(int id)
        {
            var menuDetail = $"Menu Detail for ID: {id}";
            return Ok(menuDetail);
        }
    }
}
